#ifndef _RS232_UTIL_H_
#define _RS232_UTIL_H_

#include <stdlib.h>
#include <string.h>
#include <windows.h>

#define COMMA_HEX 0x2C

void putData(BYTE* buffer, BYTE* tempData, int tempDataLen);
void printError(char* errMsg);
int matchByte(BYTE input, int* num, int arrayLen, BYTE* pattern);
void putSingleByte(BYTE *buf, BYTE *input, int* CurrentLocation);
void printLine(BYTE forPrint[], int *CurrentLocation);
void parseData(BYTE forPrint[], int CurrentLocation);
void analyzeGPGGA(BYTE forPrint[], int CurrentLocation);
void SeperateByComma(BYTE forPrint[], int CurrentLocation, char tmpSection[][30]);
int NCommaPosition(BYTE forPrint[], int CurrentLocation, int n);
int SectionLength(BYTE forPrint[], int CurrentLocation, int StartN, int EndN);
int SectionNumber(BYTE forPrint[], int CurrentLocation);
void CommaReplace(BYTE *buffer, BYTE forPrint[], int CurrentLocation);
#endif